<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Coa_jurusan extends Authenticated_Controller{
	function __construct() {
		parent::__construct();
		$this->load->model('coa_jurusan_model','coa_jurusan');
                $this->load->model('fee_driver_model','fee');
	}
	
	function index(){
		$this->list_coa_jurusan();
	}
	
	function list_coa_jurusan(){
		$data['daftar_coa_jurusan'] = $this->coa_jurusan->get_all();
		$this->load->view('template/header_view');
		$this->load->view('coa_jurusan/daftar_coa_jurusan',$data);
		$this->load->view('template/footer_view');
	}
	
	function form_add_coa_jurusan(){
		$data['daftar_asal'] = $this->fee->get_asal_tujuan();
		$data['daftar_tujuan'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('coa_jurusan/form_add_coa_jurusan',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_add_coa_jurusan(){
		$this->coa_jurusan->insert_new($_POST);
		redirect(COAJ);
	}
	
	function process_delete_coa_jurusan($id){
		$this->coa_jurusan->delete_old($id);
		redirect(COAJ);
	}
	
	function form_edit_coa_jurusan($id){
		$data = $this->coa_jurusan->get_one($id);
		$data['daftar_asal'] = $this->fee->get_asal_tujuan();
		$data['daftar_tujuan'] = $this->fee->get_asal_tujuan();
		$this->load->view('template/header_view');
		$this->load->view('coa_jurusan/form_edit_coa_jurusan',$data);
		$this->load->view('template/footer_view');
	}
	
	function process_edit_coa_jurusan($id){
		$this->coa_jurusan->update_old($id,$_POST);
		redirect(COAJ);
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
